package com.company.cloud.page.modules.app.utils;

import com.sun.org.apache.xerces.internal.parsers.DOMParser;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class TestKit {

    public static void main(String[] args) {

        String str="<div  class=\"data-com-editor\" data-editor-id='111'><p>ddddd</p><br/></div>";

        Document doc = Jsoup.parse(str);
        Element ele=doc.body().child(0);
//        System.out.println(ele.outerHtml());


//        String data_editor_id=ele.attr("data-editor-id");
//        System.out.println(data_editor_id);

        ele.addClass("data-com-editor");
        ele.attr("data-editor-id","wangjj");


        System.out.println("+++++++++++++++++++++");
        System.out.println(ele.outerHtml());





//        Elements eles= doc.getAllElements();
//
//        for(int i=0;i<eles.size();i++){
//            Element ele= eles.get(i);
//            System.out.println(ele.outerHtml());
//            System.out.println("------------------");
//        }













    }
}
